<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style  type="text/css">
* { padding:0; margin:0 auto}
.top{ height:30px;  background:#999}
.top img{ display:inline-block; border:none; vertical-align:middle}
.top a{ color:#000;text-decoration:none}
.top a:hover{ color:#F03; }
#pp{ text-align:right; }
#content{border-left:1px solid #0c0c0c;border-right:1px solid #0c0c0c;display:inline-block; border-top:1px solid #0c0c0c}
.main{text-align:center;padding-top:5px;}
</style>
</head>
<body>
<div class="main" >
<div id="content">
<div class="top" id="top"><div id="pp"><a href="javascript:void(0);" onclick="print()"><img src="@{'/public/images/print.png'}">打印</div></a></div>
<iframe id="fid" name="left" src="@{'/public/report/01.html'}" scrolling="auto" frameborder="0" style="margin:0 auto;"></iframe></div>
</div>
<script type="text/javascript" src="@{'/public/javascripts/jquery-1.11.2.min.js'}"></script>
<script type="text/javascript" src="@{'/public/javascripts/jquery.PrintArea.js'}"></script>
<script type="text/javascript">
       
	var FFextraWidth = 18;
	if (window.navigator.userAgent.indexOf("Firefox") >= 1) {
		FFextraWidth = 32;
	}
	window.onresize = window.onload = function() {
		var iframe = document.getElementById("fid");
		var pp = document.getElementById("pp");
		var top = document.getElementById("top");
		var hh = window.innerHeight;
		iframe.width = 0;
		iframe.height = (hh - 30) + "px";
		if (iframe && !window.opera) {
			iframe.style.display = "block";
			if (iframe.contentDocument
					&& iframe.contentDocument.body.offsetHeight) {
				iframe.width = iframe.contentWindow.document.body.scrollWidth
						+ FFextraWidth + 20;
			} else if (iframe.Document && iframe.Document.body.scrollHeight) {
				iframe.width = iframe.Document.body.scrollwidth;
			}
		}
		pp.style.width = iframe.width + 'px';
		top.style.width = iframe.width + 'px';
	}
	
	function print(){
		$(fid.contentDocument).find('html').printArea();
	}
	
</script>
</body>
</html> 